#include<stdio.h>
#include<stdlib.h>
typedef struct node{
    int data;
    struct node *next;
}node;
node *initlist(){
    node *head=(node*)malloc(sizeof(node));
    head->next=NULL;
    return head;
}
int main(){
    int a,n;scanf("%d",&a);
     node *list=initlist();
    while(scanf("%d",&n)&&n>=0){
        node *new=(node*)malloc(sizeof(node));
        new->data=n;
        new->next=list->next;
        list->next=new;
    }
    int i;
    node *p=list;
    for(i=0;i<a;i++){
    p=p->next;
    }
    if(p){
    printf("%d",p->data);}
    else{
        printf("NULL");
    }
    free(list);
    return 0;
}